package io.renren.modules.app.enums;

import java.util.Objects;

/**
 * 入库订单状态
 * create by znr48268 on 2018/12/12
 */
public enum InOrderStatusEnum {
    初始化(0, "初始化"),
    待入库(1, "待入库"),
    入库中(2, "入库中"),
    拣货完成(3, "拣货完成"),


    拣货数量不符(4, "拣货数量不符"),
    订单完成(5, "订单完成");
    private Integer value;
    private String text;

    InOrderStatusEnum(int i, String s) {
        this.value = i;
        this.text = s;

    }

    public static InOrderStatusEnum getEnumByValue(Integer value) {
        for (InOrderStatusEnum item : InOrderStatusEnum.values()) {
            if (Objects.equals(value, item.getValue())) {
                return item;
            }
        }
        return null;
    }

    public static String getTextByValue(Integer value) {
        if (value != null) {
            for (InOrderStatusEnum item : InOrderStatusEnum.values()) {
                if (Objects.equals(value, item.getValue())) {
                    return item.getText();
                }
            }
        }
        return "";
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
